package com.crscd.ai.config;

import com.crscd.ai.service.WeatherService;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 *
 * @description:
 * @author: liuziyang
 * @since: 10/9/25 4:14 PM
 * @modifiedBy:
 * @version: 1.0
 */
@Configuration
public class McpServerConfig {
  /**
   * 将工具方法暴露给外部的mcp client调用
   *
   * @param weatherService the weather service
   * @return the tool callback provider
   */
  @Bean
  public ToolCallbackProvider weatherTools(WeatherService weatherService) {
        return MethodToolCallbackProvider.builder()
                .toolObjects(weatherService)
                .build();
}
}
